<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns an array with the key details</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-free.html">openssl_pkey_free</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</a></div>
 <div class="up"><a href="ref.openssl.html">OpenSSL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.openssl-pkey-get-details" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkey_get_details</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_details</span> &mdash; <span class="dc-title">Returns an array with the key details</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-details-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>openssl_pkey_get_details</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$key</code></span>
   )</div>

  <p class="para rdfs-comment">
   This function returns the key details (bits, key, type).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-details-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">key</code></em></dt>

     <dd>

      <p class="para">
       Resource holding the key.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-details-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array with the key details in success or <strong><code>FALSE</code></strong> in failure.
   Returned array has indexes <em>bits</em> (number of bits),
   <em>key</em> (string representation of the public key) and
   <em>type</em> (type of the key which is one of
   <strong><code>OPENSSL_KEYTYPE_RSA</code></strong>,
   <strong><code>OPENSSL_KEYTYPE_DSA</code></strong>,
   <strong><code>OPENSSL_KEYTYPE_DH</code></strong>,
   <strong><code>OPENSSL_KEYTYPE_EC</code></strong> or -1 meaning unknown).
  </p>
  <p class="para">
   Depending on the key type used, additional details may be returned. Note that 
   some elements may not always be available.
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <strong><code>OPENSSL_KEYTYPE_RSA</code></strong>, an additional array key named <em>&quot;rsa&quot;</em>, 
     containing the key data is returned.
    </span>
     <table class="doctable informaltable">
      
       <thead>
        <tr>
         <th>Key</th>
         <th>说明</th>
        </tr>

       </thead>

       <tbody class="tbody">
        <tr>
         <td><em>&quot;n&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;e&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;d&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;p&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;q&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;dmp1&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;dmq1&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;iqmp&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

       </tbody>
      
     </table>

   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>OPENSSL_KEYTYPE_DSA</code></strong>, an additional array key named <em>&quot;dsa&quot;</em>, 
     containing the key data is returned.
    </span>
     <table class="doctable informaltable">
      
       <thead>
        <tr>
         <th>Key</th>
         <th>说明</th>
        </tr>

       </thead>

       <tbody class="tbody">
        <tr>
         <td><em>&quot;p&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;q&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;g&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;priv_key&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;pub_key&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

       </tbody>
      
     </table>

   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code>OPENSSL_KEYTYPE_DH</code></strong>, an additional array key named <em>&quot;dh&quot;</em>, 
     containing the key data is returned.
    </span>
     <table class="doctable informaltable">
      
       <thead>
        <tr>
         <th>Key</th>
         <th>说明</th>
        </tr>

       </thead>

       <tbody class="tbody">
        <tr>
         <td><em>&quot;p&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;g&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;priv_key&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

        <tr>
         <td><em>&quot;pub_key&quot;</em></td>
         <td class="empty">&nbsp;</td>
        </tr>

       </tbody>
      
     </table>

   </li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-free.html">openssl_pkey_free</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</a></div>
 <div class="up"><a href="ref.openssl.html">OpenSSL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
